******************************************************************
**** Replication for "Parliamentary Interest in Foreign Security Policy"  ****
**** Walter C. Ladwig III										      ****
**** 5/29/2024												  ****
******************************************************************

*** This code relies on a single dataset and produces the four substantive tables (10-13) reporting the results of the 8 negative binomial regression models.
*******************************************************************************

**To report out the results, the estout package was employed.  It can be installed with the following command:
ssc install estout, replace


** Analysis starts here
clear
import delimited "Lok Saba Questions Data (FPA).csv"
xtset id period


* Table 10: Base Model, Election Timing and Personal Traits (negative binomial model with MP-level random effects)
eststo clear
menbreg defence_q vm i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg ea_q vm i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg defence_q vm lasty lastm i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg ea_q vm lasty lastm i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg defence_q vm age female bachelors ls_exp fmin fjmin i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg ea_q vm age female bachelors ls_exp fmin fjmin i.period, vce(cluster id) exposure(qday)|| id:,
eststo
esttab using Table10.csv, replace compress n se aic b(%9.3f) se(%9.3f) star(* 0.05 ** 0.01 *** 0.001)


* Table 11: Party Effects (negative binomial model with MP-level random effects)
eststo clear
menbreg defence_q vm age female bachelors ls_exp fmin fjmin opp jpart i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg ea_q vm age female bachelors ls_exp fmin fjmin opp jpart i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg defence_q vm age female bachelors ls_exp fmin fjmin nationalp messop statep ethnicp i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg ea_q vm age female bachelors ls_exp fmin fjmin nationalp messop statep ethnicp i.period, vce(cluster id) exposure(qday)|| id:,
eststo
esttab using Table11.csv, replace compress n se aic b(%9.3f) se(%9.3f) star(* 0.05 ** 0.01 *** 0.001)


* Table 12: Expertise, Local Concerns and Constituency Characteristics (negative binomial model with MP-level random effects)
eststo clear
menbreg defence_q vm age female bachelors ls_exp fmin fjmin milback def_com i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg ea_q vm age female bachelors ls_exp fmin fjmin milback ea_com i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg defence_q vm age female bachelors ls_exp fmin fjmin bases industry lnwidow i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg ea_q vm age female bachelors ls_exp fmin fjmin bases industry lnwidow i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg defence_q vm age female bachelors ls_exp fmin fjmin sc st border_con urbands i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg ea_q vm age female bachelors ls_exp fmin fjmin sc st border_con urbands i.period, vce(cluster id) exposure(qday)|| id:,
eststo
esttab using Table12.csv, replace compress n se aic b(%9.3f) se(%9.3f) star(* 0.05 ** 0.01 *** 0.001)




* Table 13: Negative binomial model for total # of all written questions with MP-level random effects
eststo clear
menbreg wq vm i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg wq vm lasty lastm i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg wq vm age female bachelors ls_exp fmin fjmin i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg wq vm age female bachelors ls_exp fmin fjmin opp jpart i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg wq vm age female bachelors ls_exp fmin fjmin nationalp messop statep ethnicp i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg wq vm age female bachelors ls_exp fmin fjmin milback i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg wq vm age female bachelors ls_exp fmin fjmin bases industry lnwidow i.period, vce(cluster id) exposure(qday)|| id:,
eststo
menbreg wq vm age female bachelors ls_exp fmin fjmin sc st border_con urbands i.period, vce(cluster id) exposure(qday)|| id:,
eststo
esttab using Table13.csv, replace compress n se aic b(%9.3f) se(%9.3f) star(+ 0.10 * 0.05 ** 0.01 *** 0.001)